package day1105.first;

import day1105.common.MyUtil;
import day1105.common.Student;

import java.util.List;

import static day1105.common.MyUtil.printLine;

/**
 * @author Mr.ma
 * @since 2022/11/5 16:29
 * skip(): 跳过前n个元素
 **/
public class SkipTest {
    public static void main(String[] args) {
        List<Student> studentList = MyUtil.createStudentList();
        studentList.stream().forEach(System.out::println);
        printLine("根据id对学生进行升序排列，跳过前4个学生");
        studentList.stream().sorted((s1,s2) ->s1.getId() - s2.getId())
                .skip(4)
                .forEach(System.out::println);
    }
}
